package com.my.httpapi.api.baseApi;

import com.google.gson.annotations.SerializedName;

/**
 * Author:guohaijin
 * Date:
 * Description:抽取的一个基类的bean,直接在泛型中传data
 * SerializedName 的值和CustomGsonResponseBodyConverter对应
 */

public class BaseHttpResult<T> {
    @SerializedName(value = "code", alternate = {"statusCode"})
    private int code;
    @SerializedName(value = "message", alternate = {"Msg", "msg", "error", "err", "errorMsg", "errorMessage"})
    private String message;
    @SerializedName(value = "data", alternate = {"datas", "response"})
    public T data;

    @Override
    public String toString() {
        return "BaseHttpResult{" +
                "code=" + code +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
